package com.csweimei.rentmanagementtreasure.tenant.ui.act;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;

import com.chad.library.BR;
import com.csweimei.rentmanagementtreasure.R;
import com.csweimei.rentmanagementtreasure.base.AppConfig;
import com.csweimei.rentmanagementtreasure.base.AppViewModelFactory;
import com.csweimei.rentmanagementtreasure.databinding.ActivityMessageInfoBinding;
import com.csweimei.rentmanagementtreasure.http.entity.TabThreeBean;
import com.csweimei.rentmanagementtreasure.http.entity.TabTwoScheduleListBean;
import com.csweimei.rentmanagementtreasure.tenant.viewModel.MessInfoVM;

import me.goldze.mvvmhabit.base.BaseActivity;

public class MessageInfoActivity extends BaseActivity<ActivityMessageInfoBinding, MessInfoVM> {


    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_message_info;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    TabThreeBean.DataDTO bean;
    @Override
    public void initParam() {
        super.initParam();
        bean = (TabThreeBean.DataDTO) getIntent().getSerializableExtra(AppConfig.BUNDLE_KEY);
    }

    @Override
    public void initData() {
        super.initData();
        viewModel.setActivity(this);
        viewModel.setTitleText(bean.getMessageType());
        viewModel.getData(bean.getMessageType());
    }


    @Override
    public MessInfoVM initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this,factory).get(MessInfoVM.class);
    }
}